﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Win.CSkin.Test
{
    public partial class UCSplitButton : UserControl
    {
        public UCSplitButton()
        {
            InitializeComponent();
        }

        private string _text;
        [Browsable(true)]
        [Description("设置按钮显示文本")]
        public string ButtonText
        {
            get
            {
                return _text;
            }
            set
            {
                _text = value;
                spButton.Text = value;
            }
        }

        private string _itemtext;
        [Browsable(true)]
        [Description("设置下拉菜单显示文本")]
        public string MenuItemText
        {
            get
            {
                return _itemtext;
            }
            set
            {
                _itemtext = value;
                menuOkClose.Text = value;
            }
        }

        //定义事件
        [Browsable(true)]
        [Description("按钮点击事件")]
        public event EventHandler SpButtonClick;
        //定义事件
        [Browsable(true)]
        [Description("下拉菜单点击事件")]
        public event EventHandler MenuItemClick;


        private void spButton_Click(object sender, EventArgs e)
        {
            SpButtonClick(sender, e);
        }

        private void menuOkClose_Click(object sender, EventArgs e)
        {
            MenuItemClick(sender, e);
        }

    }
}
